﻿using System;
using System.Windows.Forms;

namespace SanGuoXiuGai
{
    static class Program
    {
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
        [STAThread]
        static void Main()
        {
            bool runone;
            System.Threading.Mutex run = new System.Threading.Mutex(true, "SanGuoXiuGai", out runone);
            if (runone)
            {
                // 启动自动更新程序
                //Process.Start("AutoUpdate.exe");
                // 启动主窗体
                run.ReleaseMutex();
                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                frmUpdate frm = new frmUpdate();
                int hdc = frm.Handle.ToInt32();
                Application.Run(frm);
                IntPtr a = new IntPtr(hdc);
            }
            else
            {
                MessageBox.Show("程序已运行。");
            }
        }
    }
}
